Building the nervous system of autonomous software
Track 03 of four. The plumbing layer behind every production system on this site, lifted out and written twice: once in async Python, once in modern ESM JavaScript. So the patterns are language-portable.
AgentKernel is the engines repo: the infrastructure layer that sits underneath the agentic systems. Every production product on this site uses some subset of these six engines. The repo isolates them, removes the application-specific bits, documents the trade-offs, and ships them in both Python and JavaScript so the patterns travel.
Routes LLM traffic across multiple providers (Anthropic, OpenAI, Ollama). Each provider has a circuit breaker; hard failures (rate limit, 5xx) trip the breaker and shift traffic to the next provider in priority order. Includes a request-budget guard so a runaway loop can't bankrupt you.
I named it “Repeat Failure Guard” in the production system; in the open-source release it's just SCAR. SQLite-backed. Takes a deterministic SHA-256 of the canonicalised input, returns the cached output within a TTL. Eliminates wasted spend on repeated identical agent calls : which happens more than you'd expect.
Four retrieval tools in one engine. Web search across providers (SerpAPI, Brave, DuckDuckGo). Firecrawl-based page scraping and content extraction. A dependency graph builder (graphify) that maps relationships between code files or data nodes so agents can navigate context without reading everything. A content analyzer that scores relevance, authority, and sentiment.
Standard producer/consumer task queue with a stateful circuit breaker per downstream service. When a downstream goes flaky the consumer enters half-open mode and probes; dead-letter handling for tasks that exhaust retries. SSE streaming layer sits alongside so a connected browser can watch task progress in real time without polling.
Three independent tools. A multi-provider TTS voice engine (ElevenLabs, Gemini TTS) that compiles audio into WAV containers. A subtitle generator that aligns text segments to audio timing. ChaiPitch: an AI copywriting engine that generates Hinglish WhatsApp outreach messages for Indian D2C leads, including a Remotion-compatible StoryTemplate for programmatic video output.
Short-lived access tokens, longer-lived refresh tokens, refresh-token rotation on use, token revocation on password reset. Full CRUD layer with Prisma (ESM) and SQLAlchemy (Python) schemas, multi-tenant database structure, and async database session management.
Two reasons. First, the production work is split : the Agentic SDLC pipeline is Python, the WellnessInYou backend has parts in TypeScript/ESM. I needed the patterns to travel cleanly between them. Second, writing the same engine twice forces clarity. If the JavaScript version is twice as long as the Python version, one of them is doing something wrong : usually it's something I should fix in both.
These engines aren't novel research. They're well-known patterns implemented carefully. The reason this track exists is that if you're hiring me, you want to see how I treat the unsexy infrastructure layer. The router, the cache, the queue, the webhook verifier : this is the work that determines whether a production system stays up.
Open the router engine in both languages and compare them. If the patterns are clearly the same and the differences are explained by language idioms, that's the signal I'd want a reviewer to take away.